<template>
	<view>
		<baseHead :title="list.globalData.userRole == 0?'注销账号':'注销企业'" :showReturn="true" :right="false" @clickRight="clicktijiao"></baseHead>
		<view class="content">
			<view class="box">
				<image src="/static/image/my/zxzh.png" class="image"></image>
				<view>
					注销账号是不可恢复的操作。操作之前，请确认注销账号会带来的后果。
				</view>
			</view>
			
			<view class="text">
				<view style="line-height: 45rpx;" v-html="contentData">{{contentData}}</view>
			</view>
		</view>
		<view class="btnbox" @click="clickzx">
			<view class="btn">
				继续注销
			</view>
		</view>
	</view>
</template>

<script>
	import baseHead from '@/pages/component/baseHead.vue'

	export default {
		data() {
			return {
				contentData: '',
				list:null,
			}
		},
		components: {
			baseHead
		},
		created() {
			this.fuwuxieyi();
			this.getlist()
		},
		methods: {
			
			getlist(){
				this.list = getApp()
			},
			
			fuwuxieyi() {
				this.$http.huirc.configcode({
					Id: 7000
				}).then(res => {
					console.log(res);
					if (res.Success) {
						this.contentData = res.Result.Value
					}
				})
			},
			clickzx(){
				let that = this;
				uni.showModal({
					title: "提示",
					content: that.list.globalData.userRole == 0?'确认注销账号吗？':'确认注销企业吗？',
					success: function(res) {
						if (res.confirm) {
							that.$http.huirc.accountCancellation().then(res=>{
								if(res.Success){
									uni.$u.toast("注销成功");
									that.$util.tuiculogout();
								}else {
									uni.$u.toast(res.Message);
								}
							})
						}
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		padding: 30rpx;

		.box {
			padding: 20rpx;
			text-align: center;

			.image {
				width: 102rpx;
				height: 93.72rpx;
			}

			view {
				text-align: start;
				font-size: 28rpx;
				font-weight: 400;
				color: #000000;
				line-height: 46rpx;

			}
		}

		.text {
			padding: 20rpx;
			background-color: #fff;
			border-radius: 10rpx;
			margin-bottom: 150rpx;
		}

	}

	.btnbox {
		width: 100%;
		height: 88rpx;
		box-sizing: border-box;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		text-align: center;
		background: #3476FE;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		opacity: 1;
		margin: 20rpx 0 0 0;
		.btn{
			font-size: 30rpx;
			line-height: 88rpx;
			font-weight: bold;
			color: #FFFFFF;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
		}
	}
</style>